home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Fall / rerun-1985-fall.d64 / test taker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  75 lines

  1. 10 poke53280,1:poke53281,1:poke646,2
  2. 20 ll=22:ifpeek(44)=8thenll=40
  3. 40 p1=ll/2-6:printchr$(14):p2=p1+ll+3
  4. 50 print"[147]"tab(ll*5.5-5)"[209][213][197][211][212][201][207][206][211]![145][145][145][157][157][157][157][157][157][157][157][157][157][157][157]";
  5. 52 fori=1to15:print"*";:gosub1300:next:fori=1to10:print"[157]*";:gosub1300:next
  6. 54 fori=1to15:print"[157][157]*";:gosub1300:next:fori=1to10:print"[157][145]*";:gosub1300:next
  7. 56 print"a self-test[157][157][157][157][157][157][157][157][157]program":gosub1200:gosub1200
  8. 90 gosub505
  9. 100 print"[147]"tab(p1)"*** [205][197][206][213][146] ***":printtab(p1)"[157][212][146]est
  10. 105 [153][163]p1)"cmdstr$waitrill":[153][163]p1)"cmd(NULL)waitoad new program
  11. 107 printtab(p1)"[157][211]elect one
  12. 110 [141]1000
  13. 112 [139]x$[178]"d"[167][141]200:[137]100
  14. 114 [139]x$[178]"t"[167][141]300:[137]100
  15. 116 [139]x$[178]"l"[167][141]500:[137]100
  16. 120 [137]110
  17. 199 [143] drill subroutine
  18. 200 wr[178]0:s[178]n:[129]i[178]1[164]n:rn%(i)[178]i:[130]
  19. 205 rd[178][181]([187](x)[172]s)[170]1:f[178]0:r[178]rn%(rd)
  20. 215 [153]"load#"r[163]ll[171]10)"wait(NULL)o go"s:[153][163]ll[171]10)"(NULL)rong"wr
  21. 220 [153][163]p2)"str$(NULL)right$(NULL)(NULL)":[153]q$(r,1):[153]""
  22. 225 [141]400:[139]an$[178]"\"[167][142]
  23. 230 [139]an$[178]""[167]255
  24. 235 [139]c[178]1[175]f[178]0[167][141]1100:[129]i[178]rd[164]s:rn%(i)[178]rn%(i[170]1):[130]:s[178]s[171]1:[137]260
  25. 240 [139]c[178]1[167][141]1100:[137]260
  26. 245 [139]f[178]0[167]f[178]1:[153]"(NULL)rong -":[153]"(NULL)ry again":wr[178]wr[170]1:[137]247
  27. 246 [137]250
  28. 247 [141]1200:[137]215
  29. 250 [153]"(NULL)rong again -
  30. 255 gosub485
  31. 260 ifs>0then205
  32. 295 print"[147]"tab(p1+3)"[196][210][201][204][204]":print"[212]he drill had a total of "n"questions."
  33. 296 printtab(p1)"[215]rong:"wr"":gosub1400:return
  34. 299 rem test subroutine
  35. 300 wr=0:rt=0:r=1
  36. 310 print"[147]#"rtab(ll-10)"[146][210]ight"rt:printtab(ll-10)"[215]rong"wr
  37. 320 printtab(p2)"[212][197][211][212]":printq$(r,1)""
  38. 325 gosub400:ifan$="\"thenreturn
  39. 330 ifc=1thengosub1100:rt=rt+1:goto340
  40. 335 wr=wr+1:gosub480
  41. 340 ifr<nthenr=r+1:goto310
  42. 345 print"[147]"tab(p1+3)"[212][197][211][212]":print"[212]he test had a total  of"n" questions."
  43. 350 printtab(p1)"[157][212]otal right:"rt:printtab(p1)"[157][212]otal wrong:"wr
  44. 355 printtab(p1-3)"[212]his is"int(rt/n*100)"% right"
  45. 360 d=int((rt/n-.5)*13.9):ifd<1thend=1
  46. 365 restore:fori=1tod:readf$:next:printtab(p1+ll)f$"!":gosub1400:return
  47. 380 data"[212][197][210][210][201][194][204][197]","[206][207][212] [199][207][207][196]","[193][214][197][210][193][199][197]","[214][197][210][217][160][199][207][207][196]","[197][216][195][197][204][204][197][206][212]","[207][213][212][211][212][193][206][196][201][206][199]"
  48. 400 poke198,0:an$="":inputan$:le=len(q$(r,2))
  49. 410 k=le+1:fori=1tole:ifmid$(q$(r,2),i,1)="\"thenk=i:i=le
  50. 430 next:c=0:ifleft$(an$,k-1)=left$(q$(r,2),k-1)thenc=1
  51. 440 return
  52. 480 printtab(p1)"[215]rong -"
  53. 485 print"[195]orrect answer is":printleft$(q$(r,2),k-1)" "mid$(q$(r,2),k+1)
  54. 486 gosub1400:return
  55. 499 rem load subroutine
  56. 500 print"[147][204]oad new program.":print"[193]re you sure?  ([217]/[206])":gosub1000
  57. 502 ifx$<>"y"thenreturn
  58. 505 print"[147]"tab(p1)"*** [204][207][193][196][146] ***
  59. 510 [153]"program name":[133]nf$
  60. 520 [153]"right$nsert question file disk. (NULL)ress any keywhen ready":[141]1000
  61. 530 [159]2,8,2,"0:"[170]nf$[170]",s,r"
  62. 540 [132]2,n
  63. 550 [151]49,[194](47):[151]50,[194](48):[134]q$(n,2):[134]rn%(n[170]1):n[178]1
  64. 560 [132]2,q$(n,1),q$(n,2):[139]st[178]0[167]n[178]n[170]1:[137]560
  65. 570 [160]2:[153]"ascile "nf$:[153]"loaded with"n:[153]"entries":[141]1400
  66. 575 [142]
  67. 999 [143] miscellaneous subroutines
  68. 1000 [151]198,0
  69. 1001 [161]x$:[139]x$[178]""[167]1001
  70. 1010 [142]
  71. 1100 [153][163]p1)"** len(NULL)(NULL)(NULL)vallen(NULL) **
  72. 1200 fort=1to1000:next:return
  73. 1300 forl=1to30:next:return
  74. 1400 printtab(p1)"[208]ress any key.":goto1000
  75.